﻿<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 文章管理 <span class="c-gray en">&gt;</span> 文章列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> <a class="btn btn-primary radius" data-title="添加文章" data-href="{{:url('admin/article/create')}}" onclick="Hui_admin_tab(this)" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加资讯</a></span> <span class="r">共有数据：<strong>{{$totalCount}}</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="80">ID</th>
					<th>文章标题</th>
					<th width="80">文章分类</th>
					<th width="240">发布时间</th>
					<th width="75">浏览次数</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody>

			{volist name="articles" id="vo"}
				<tr class="text-c">
					<td><input type="checkbox" value="" name=""></td>
					<td>{{$i}}</td>
					<td class="text-l">{{$vo.title}}</td>
					<td>{{$vo.cat_name}}</td>
					<td>{{$vo.created_at}}</td>
					<td>{{$vo.views}}</td>
					<td class="f-14 td-manage">
					       
<a style="text-decoration:none" class="ml-5"  href="{{:url('/admin/article/'.$vo.id.'/edit')}}" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> 
		
<a style="text-decoration:none" class="ml-5" onClick="delArt({{$vo.id}})" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
				</tr>
				{/volist}
			</tbody>

		</table>
			<div class="col-offset-10"> {{$articles->render()}}</div>
	</div>
</div>

</body>
</html>
<script>
function delArt(id){
	layer.confirm('你确定要删除吗??',function(){
		$.ajax({
			type:"DELETE",
			dataType:"json",
			url:"/admin/article/"+id,
			success:function(data){
				if(data.status=='success'){
				
					layer.msg(data.info,{icon:1,time:1000},function(){
						location.href='/admin/article';	
					});
				}else{
					layer.msg(data.info,{icon:2,time:1000},function(){
						location.href='/admin/article'; 	
					});
				
				}
			
			}	
		
		});	
			

	})

}

</script>





